home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
help
/
readm
< prev
next >
Wrap
Text File
|
1994-04-25
|
1KB
|
43 lines
readm:
Syntax: readm ( "filename" )
Description:
Readm reads a generic matrix of data from the file denoted by
the argument. The return value is the newly created matrix.
The file format is generic ASCII. The rows of the matrix are
separated by newlines, and the columns are separated by
whitespace. Unecessary newlines, either before, or after the
data will confuse readm, and will probably result in an error
message. Only one matrix can be stored in a file. If you need
to store more than one matrix in a file, use write(), and
read().
Readm can only read in numeric matrices. The result of reading
in string matrices is undefined.
Example:
1 2 3 4
5 6 7 8
9 10 11 12
The above values in a file called "test" would be read in like:
> a = readm("test")
a =
matrix columns 1 thru 4
1 2 3 4
5 6 7 8
9 10 11 12
Readm exists to read in data from other programs. In many
cases a simple awk script will filter the other programs
output into one or more columns of data. readm() will read the
data into the matrix, then the matrix can be reshaped if
necessary.
See Also: reshape, writem